import Vue from 'vue'
import Vuex from 'vuex'
import getters from './getters'
import app from './modules/app'
import settings from './modules/settings'
import user from './modules/user'
import tagsView from './modules/tagsView'
import menu from './modules/menu'

Vue.use(Vuex)

const store = new Vuex.Store({
  modules: {
    app,
    settings,
    user,
    tagsView,
    menu
  },
  getters
})

export default store

// import Vue from 'vue'
// import Vuex from 'vuex'


// Vue.use(Vuex)

// export default new Vuex.Store({
//   state: {
//     username: 'wmy',
//     toke n: ''
//   },
//   getters: {
//     fullName: state =>  state.username + ' Chan',
//     username: state =>  state.username,
//     token: state =>  state.token
//   },
//   mutations: {
//     SET_NAME: (state, username) => {
//       state.username = username
//     },
//     SET_TOKEN: (state, token) => {
//       state.token = token
//     }
//   },
//   actions: {
//     updateUserName({ commit }, newName) {
//       // 可以加入异步操作代码，发起Ajax请求
//       // 调用mutation提交操作
//       commit('SET_NAME', newName)
//     },
//     login({ commit }, userInfo){
//        // 项目后期进行ajxa进行登录验证
//        const { username, password } = userInfo
//        commit('SET_NAME', username)
//        commit('SET_TOKEN', 'admin_token')
//     }
//   },
//   modules: {
//   }
// })


